package h_eekwan.basic;

import java.util.Scanner;

public class J03_Tax1 {

	public static void main(String[] args) {
		// 세금 계산 프로그램
		// 미혼인 경우 : 연봉 3000 미만 - 10%, 연봉 3000이상 - 25%
		// 결혼인 경우 : 연봉 6000 미만 - 15%. 연봉 6000이상 - 35%
		
		// 선생님과 풀이
/*		Scanner sc = null; 
		String isMarryed =" ";		//결혼여부
		int Marryed;			// 결혼여부
		int salary;
		int tax = 0;
		
		sc = new Scanner(System.in);
		System.out.println("결혼여부는? (미혼: 0, N / 기혼: 1, Y)");
		// isMarryed = sc.nextInt();
		Marryed = sc.nextInt();
		System.out.println("연봉은 ? ");		
		salary=sc.nextInt();
		
		
		// 표현식에서 문자열 비교는 == 연산자로 할수 없음 !!
		// 문자열은 객체 object형이기 때문
		if (Marryed == "미혼")
			System.out.println("미혼!");
		else if (Marryed =="기혼")
			System.out.println("기혼!");
		
		
		if (Marryed == 0){
			if ( salary < 3000) 
				tax=(int)(salary * 0.1);
			else
				tax=(int)(salary * 0.25);
			isMarryed = "미혼";
		} else if (Marryed == 1){
			if ( salary < 6000)
				tax=(int)(salary * 0.15);
			else
				tax=(int)(salary * 0.35);
			isMarryed = "기혼";
		}
		System.out.println("결혼여부: " + isMarryed);
		System.out.println("연봉 : " + salary);
		System.out.println("세금 : " + tax);
		
		sc.close();*/
	
		//나의 풀이
		
		
		Scanner sc = null;
		int marry;
		double MSG1 = 0.1;
		double MSG2 = 0.25;
		double MSG3 = 0.15;
		double MSG4 = 0.35;	
		int comm;
		int tax=0;
			
		
		sc = new Scanner(System.in);
		System.out.println("미혼 0, 결혼 1 ");
		marry = sc.nextInt();
		System.out.println("연봉 :");
		comm = sc.nextInt();
		
		if (marry == 0){
			if (comm < 3000 )
				tax = (int)(comm * 0.1);
			else 
				tax= (int)(comm * 0.25);
		} else if (marry == 1){
			if (comm < 6000)
				tax= (int)(comm * 0.15);
			else 
				tax= (int)(comm * 0.35);
		}
		
		System.out.println("결혼여부 : " + marry);
		System.out.println("연봉 : " + comm);
		System.out.println("tax : " + tax);
		sc.close();
		
		/*sc.close();
		if (marry == "N"){
			if (comm < 3000 )
				System.out.println(" 납부하실 세금 : " + (int)(comm * MSG1));
			else System.out.println("납부하실 세금 :" + (int)(comm * MSG2));
		} else if (marry == "Y"){
			if (comm < 6000)
				System.out.println(" 납부하실 세금 :" + (int)(comm * MSG3));
			else System.out.println(" 납부하실 세금 :" + (int)(comm * MSG4));
		}*/
		
						
		
		
		
		
		/*
		 if (marry == "N");
			if (comm <= 3000 ) System.out.println(" 납부하실 세금 : " + (int)(comm * MSG1));
		else System.out.println("납부하실 세금: " + ((int)(comm * MSG2)));	
		 */
		
		
		
	

	}

}
